package scripts;

import api.WebVerifyCodeApi;
import org.testng.Assert;
import org.testng.annotations.Test;
import util.ResponseData;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Random;

public class TestWebVerify {
    private static final WebVerifyCodeApi verify_code=new WebVerifyCodeApi();
    @Test
    public static void test_01_get_code() throws IOException, URISyntaxException {
        String Id= String.valueOf(new Random().nextDouble());
        ResponseData verify = verify_code.get_verify(Id);
        Assert.assertEquals(verify.getCode(),200);
    }
    @Test
    public static void test_02_get_phone() throws IOException, URISyntaxException {
        String phone="18862211930";
        String code="8888";
        String type="reg";
        ResponseData responseData = verify_code.get_phone(phone, code, type);
        Assert.assertEquals(responseData.getCode(),200);
    }
    @Test
    public static void test_03_reg() throws IOException, URISyntaxException {
        ResponseData responseData=verify_code.get_reg("18862211930","test001","8888","666666","on");
        Assert.assertEquals(responseData.getCode(),200);
    }
}
